import React, { Component } from 'react'
import { Navigator, View, Text } from 'react-native'
import { Provider } from 'react-redux'
import { createStore, applyMiddleware, combineReducers } from 'redux'
import thunk from 'redux-thunk'

import * as reducers from './redux'
import IfredomApp from './ifredom'
const createStoreWithMiddleware = applyMiddleware(thunk)(createStore)
// combineReducers函数调用你的一系列 reducer，每个 reducer 根据它们的 key 来筛选出 state 中的一部分数据并处理，然后这个生成的函数再将所有 reducer 的结果合并成一个大的对象。
const reducer = combineReducers(reducers)
const store = createStoreWithMiddleware(reducer)

// 打印初始状态
export default class App extends Component {

    constructor(props) {
        super(props)
    }
    render() {
        return (
            <Provider store={store}>
                <IfredomApp />
            </Provider>
        )
    }
    componentDidMount(){

    }
}
